﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFDemo
{
    public class CrawlerCompany:DbContext
    {
        public CrawlerCompany() : base("name=CrawlerCompany")
        {

        }
        public DbSet<People> People { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
    public class Option
    {
        public static void Add()
        {
            People people = new People() { UserName="alvin",Age="14"};
            CrawlerCompany company = new CrawlerCompany();
            company.People.Add(people);
            company.SaveChanges();
        }
    }
}
